package cn.liulin.java8.collector;

import com.alibaba.fastjson.JSON;

import java.util.List;
import java.util.Map;
import java.util.stream.IntStream;

/**
 * cn.liulin.java8.collector$
 *
 * @author ll
 * @date 2021-10-19 11:43:01
 **/
public class CollectorSelfUse {
    public static void main(String[] args) {
        int n = 100;
        selfUseOne(n);
    }

    private static void selfUseOne(int n) {
        Map<Boolean, List<Integer>> collect = IntStream.rangeClosed(2, n).boxed()
                .collect(new PrimeNumberCollector());
        System.out.println(JSON.toJSONString(collect));
    }

}
